package com.bci.pwtz.service.impl;

import java.util.List;

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.bci.pwtz.exception.PwtzDatabaseException;
import com.bci.pwtz.mysql.dao.VzyzfMapper;
import com.bci.pwtz.mysql.model.Vzyzf;
import com.bci.pwtz.service.VzyzfService;
@Service
public class VzyzfServiceImpl implements VzyzfService
{
    private static final Logger logger = Logger.getLogger(MessageServiceImpl.class);
    private VzyzfMapper objMapper;
    
    public VzyzfMapper getObjMapper()
    {
        return objMapper;
    }

    public void setObjMapper(VzyzfMapper objMapper)
    {
        this.objMapper = objMapper;
    }

    @Override
    public List<Vzyzf> selectDeviceList(String deviceid,int status) throws PwtzDatabaseException
    {
        if(logger.isDebugEnabled()){
            logger.debug("selectDeviceList: deviceid="+deviceid+"status="+status);
        }
        List<Vzyzf> list=null;
        try{
            list=objMapper.selectDeviceList(deviceid, status);
        }catch(DataAccessException e){
            logger.error(ExceptionUtils.getStackTrace(e));
            throw new PwtzDatabaseException();
        }
        return list;
    }

}
